<%@page contentType="text/html; charset=utf-8" language="java" errorPage="error.jsp"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
String subtitle = "用户注册";
String scripts = "/static/js/Validform_min.js";
String styles = "/static/css/validation.css?v=0.0.1";
%>
<%@ include file="/include/header.jspf"%>

<script>
$(document).ready(function() {
	
	$("#regForm").Validform({
		btnSubmit:"#btn_sub",
		tiptype:function(msg,o,cssctl){
			if(o.obj){
					var objtip=o.obj.parent().parent().find(".Validform_checktip");
					cssctl(objtip,o.type);
					objtip.text(msg);
				}
		},
		tipSweep:false,
		postonce:true
	});

	$("#captcha_refresh,#captcha_img").click(function(){
		var o = $("#captcha_img");
		var ts = new Date().getTime();
		var src = o.attr("src");
		src = src.substr(0,src.indexOf("ts"));
		src += "ts="+ts;
		o.attr("src",src);
	});
});
</script>

<body>

  <div id="header" class="wraper">
  </div>
   <div id="bodier" class="wraper">
	<form id="regForm" action="/account/signup.do" method="post">
		<div class="aline">
			<label>邮 箱：</label>
			<div>
				<input type="text" name="name" value='${name!=null?name:""}' ajaxurl="/account/asnynamecheck.do" datatype="e" nullmsg="请输入邮箱地址！" errormsg="请输入邮箱地址！"/>
			</div>
			<c:choose>
			   <c:when test="${null!=errors.name}">    
				   <div class="Validform_checktip Validform_wrong">
						<c:forEach items="${errors.name}" var="err">
							${err}
						</c:forEach>
					</div>
			   </c:when>
			   <c:otherwise>  
				<div class="Validform_checktip">请输入常用的邮箱地址</div>
			   </c:otherwise>
			</c:choose>
		</div>
		<div class="aline">
			<label>密  码：</label>
			<div>
				<input type="password" name="password" datatype="s6-20" nullmsg="请设置密码！" errormsg="密码范围在6~20位之间，不能使用空格！"/>
			</div>
			<c:choose>
			   <c:when test="${null!=errors.password}">    
				   <div class="Validform_checktip Validform_wrong">
						<c:forEach items="${errors.password}" var="err">
							${err}
						</c:forEach>
					</div>
			   </c:when>
			   <c:otherwise>  
				<div class="Validform_checktip">密码范围在6~20位之间，不能使用空格</div>
			   </c:otherwise>
			</c:choose>
		</div>
		<div class="aline">
			<label>确认密码：</label>
			<div>
				<input type="password" name="confirmPassword" datatype="*" recheck="password" errormsg="您两次输入的账号密码不一致！"/>
			</div>
			<c:choose>
			   <c:when test="${null!=errors.confirmPassword}">    
				   <div class="Validform_checktip Validform_wrong">
						<c:forEach items="${errors.confirmPassword}" var="err">
							${err}
						</c:forEach>
					</div>
			   </c:when>
			   <c:otherwise>  
				<div class="Validform_checktip">两次输入密码须一致</div>
			   </c:otherwise>
			</c:choose>
		</div>
		<div class="aline">
			<label>昵  称：</label>
			<div>
				<input type="text" name="displayName" value='${displayName!=null?displayName:""}' datatype="s1-16" nullmsg="请输入昵称！" errormsg="昵称最多12个字符！"/>
			</div>
			<c:choose>
			   <c:when test="${null!=errors.displayName}">    
				   <div class="Validform_checktip Validform_wrong">
						<c:forEach items="${errors.displayName}" var="err">
							${err}
						</c:forEach>
					</div>
			   </c:when>
			   <c:otherwise>  
				<div class="Validform_checktip">昵称最多12个字符</div>
			   </c:otherwise>
			</c:choose>
		</div>
		<div class="aline">	
			<label>验证码：</label>
			<div>
				<input type="text" name="captcha" datatype="s4-10" nullmsg="请输入验证码！" errormsg="请输入验证码（4-10个字符）！"/>
				<c:choose>
				   <c:when test="${null!=errors.captcha}">    
					   <div class="Validform_checktip Validform_wrong">
							<c:forEach items="${errors.captcha}" var="err">
								${err}
							</c:forEach>
						</div>
				   </c:when>
				   <c:otherwise>  
					<div class="Validform_checktip"></div>
				   </c:otherwise>
				</c:choose>
				<div>
				<img id="captcha_img" width="150px" height="60px" src="/captcha.jpg?token=5002428870829195531&ts=0" style="border:1px solid #ddd">
				<a id="captcha_refresh" href="#" title="看不清左边的字符">看不清？</a>
				</div>
			</div>
		</div>
		<div class="aline"> 
			<input type="checkbox" name="check" checked="checked" datatype="checkbox"  errormsg="请先阅读并同意搜车客服务条款！"/>
			同意“<a href="aggrement.html">服务条款</a>”和“<a href="aggrement.html">隐私权保护和个人信息利用政策</a>” 
			<div class="Validform_checktip"></div>
		</div>
		<div class="aline">
			<input id="btn_sub" name="_finish" type="submit" value="注册"/>
			<input name="token" type="hidden" value="5002428870829195531"/>
		</div>

		<div class="aline">
			已经注册，<a href="/account/login.jsp" class="buttonB">登入</a>
		</div>
	</form>
  </div>
   <div id="footer" class="wraper">
  </div>

<%@ include file="/include/footer.jspf"%>